import service from './service'
import type { RequestConfig } from './types'

interface IRequestConfig<T> extends RequestConfig {
  data?: T
}
interface IResponse<T> {
  code: number
  message: string
  data: T
}

// TODO 类型有问题 待解决
const API = <T, K = any>(config: IRequestConfig<T>) => {
  //   return service.request<IResponse<K>>(config)
  return service.request
}

export default API
